<script setup lang="ts">

import AssingmentNumBar from "../../components/AssingmentNumBar.vue";
import {onMounted, ref} from "vue";
import {getDepList} from "../../apis/DepartmentApi.ts";
import {ElMessage} from "element-plus";
const depId = ref('')
const depList = ref([])
const getDep = async () => {
  const res = await getDepList();
  if (res.code === 200) {
    depList.value = res.data
  }else{
    ElMessage.error(res.msg)
  }
}
onMounted(async () => {
  await getDep()
  depId.value = depList.value[0].id
})
</script>

<template>
  所属学院:
  <el-select v-model="depId" placeholder="Select" style="width: 240px;margin: 0 auto;">
    <el-option
        v-for="item in depList"
        :key="item.id"
        :label="item.name"
        :value="item.id"
    />
  </el-select>
  <el-divider/>
<AssingmentNumBar :dep-id="depId"/>
</template>

<style scoped>

</style>